<template>
    <div :style="{marginTop:$store.state.navbarHeight+12+'rpx'}">
        <Navbar title="زاكاسلىرىم" :showIcon="true" bgColor="bg-gradual-2" />
        <div class="wrap" :style="{marginTop:customBar()*2+12+'rpx'}">
            <div class="order-wrap">
                <div class="item" v-for="(item, index) in list" :key="index">
                    <span class="time">{{formatDate(new Date(item.create_time).getTime())}}</span>
                    <span class="type" style="background:#61affe" v-if="item.type=='ADMIRE'">تارتۇقلاش</span>
                    <span class="type" style="background:#49cc90" v-if="item.type=='VIP'">ئالىي ئەزا</span>
                    <span class="type" style="background:#49cc90" v-if="item.type=='VIDEO'">كىنو</span>
                    <span class="money" v-if="item.money">{{(item.money/100).toFixed(2)}} يۈەن</span>
                </div>
            </div>
            <div class="empty">
                <div class="notice">تۈگەپتۇ</div>
            </div>
        </div>
    </div>

    </div>
</template>

<script>
import { formatDate } from "@/utils";
import Navbar from "@/components/Navbar.vue";
import { mapGetters } from "vuex";
export default {
    components: {
        Navbar
    },
    data() {
        return {
            list: []
        };
    },
    methods: {
        ...mapGetters(["customBar", "statusBar", "clientRect"]),
        formatDate,
        async getOrder(uid) {
            try {
                let res = await this.$http.get("/mpGetOrder", { uid });
                this.list = res.list;
            } catch (error) {}
        }
    },
    onLoad() {
        let { uid } = this.$root.$mp.query;
        this.getOrder(uid);
    },
    onShareAppMessage() {
        return {
            title: "مارس كىنوخانىسى",
            path: `/pages/Home/Home`,
            success: res => {
                console.log("share-success");
            },
            fail: () => {
                console.log("share-fail");
            },
            complete: () => {}
        };
    }
};
</script>

<style lang="scss" scoped>
.order-wrap {
    border: 1px solid transparent;
    .item {
        width: 98%;
        height: 93rpx;
        box-shadow: 0 0 8rpx 2rpx rgba(0, 0, 0, 0.15);
        border-radius: 22rpx;
        margin: 0 auto;
        display: flex;
        justify-content: space-around;
        align-items: center;
        margin-bottom: 10rpx;

        &:first-of-type {
            margin-top: 10rpx;
        }
        .time {
            color: #123;
        }
        .type {
            height: 60%;
            border-radius: 36rpx;
            width: 150rpx;
            background: #f8f8f8;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
            font-size: 27rpx;
        }
    }
}
</style>